﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;

namespace PDX
{
    /// <summary>
    /// A collection of custom DataTemplates to apply to PDX <see cref="Element"/>s.
    /// </summary>
    public class CustomTemplateCollection : List<DataTemplate>
    {
    }

    /// <summary>
    /// A declaration of a property. A declaration is typically used to generate
    /// an <see cref="IPropertyModel"/> somewhere down the tree.
    /// </summary>
    public class Declaration : IDeclarationBuilder
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="Declaration"/> class.
        /// </summary>
        public Declaration()
        {
            CustomTemplates = new CustomTemplateCollection();
        }

        /// <summary>
        /// Builds the declarations.
        /// </summary>
        /// <param name="target">The target.</param>
        /// <returns></returns>
        public IEnumerable<Declaration> BuildDeclarations(object target)
        {
            yield return this;
        }

        /// <summary>
        /// Gets or sets the property path.
        /// </summary>
        /// <value>
        /// The property path.
        /// </value>
        public string Path { get; set; }

        /// <summary>
        /// Gets or sets the custom templates.
        /// </summary>
        /// <value>
        /// The custom templates.
        /// </value>
        public CustomTemplateCollection CustomTemplates { get; set; }
    }
}
